<%= render "supported_sharing_services/type_xauth", sharing_service: sharing_service, status: status, record: record do %>
  <%= form_for(record) do |f| %>
    <%= f.hidden_field :service_id, value: sharing_service.service_id %>
    <%= f.hidden_field :operation, value: "authorize" %>

    <div class="mb-4">
      <%= render Form::TextInputComponent.new do |text| %>
        <% text.label_content do %>
          <label for="<%= sharing_service.service_id %>_username">Username</label>
        <% end %>
        <% text.input do %>
          <% text_field_tag 'username', '', id: "#{sharing_service.service_id}_username", class: "peer text-input" %>
        <% end %>
      <% end %>
    </div>

    <%= render Form::TextInputComponent.new do |text| %>
      <% text.label_content do %>
        <label for="<%= sharing_service.service_id %>_password">Password</label>
      <% end %>
      <% text.input do %>
        <% password_field_tag 'password', '', id: "#{sharing_service.service_id}_password", class: "peer text-input" %>
      <% end %>
    <% end %>

    <%= render Settings::ButtonRowComponent.new do %>
      <%= button_tag "Cancel", type: "button", class: "button button-tertiary button-inline", data: {action: "expandable#toggle"} %>
      <%= button_tag "Save", type: "submit", class: "button button-primary-plain" %>
    <% end %>
  <% end %>
<% end %>
